import controlMap from "./controls";

const Control: React.FC<{ name: string }> = ({ name }) => {
  const ControlComponent = controlMap[name];
  return <ControlComponent />;
};

const LoadControl = () => {
  const items = ["Button", "Image"];

  return (
    <div>
      {items.map((t) => (
        <Control name={t} />
      ))}
    </div>
  );
};

export default LoadControl;
